Given an integer, return its base 7 string representation.
Input: 100 Output: "202"
Input: -7 Output: "-10"
Note: The input will be in range of [-1e7, 1e7].
classSolution: defconvertToBase7(self, num: int) ->str: ifnum>=7: returnself.convertToBase7(num//7) +str(num%7) elifnum<0: return'-'+self.convertToBase7(-num) elifnum<7: returnstr(num)